﻿<UserControl x:Class="GrooveSharp.FullScreenInfo"
             xmlns:local="clr-namespace:GrooveSharp"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" d:DesignHeight="1000" d:DesignWidth="654" SizeChanged="UserControl_SizeChanged">

    <UserControl.Resources>
        <!-- 
            The expressions (UIElement.RenderTransform).(TransformGroup.Children)[1] come from
            http://dotnet.dzone.com/articles/wpf-storyboard-%E2%80%93-what-it-and
            -->
        <!--Storyboard x:Key="LoadStoryboard">

            <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[1].(TranslateTransform.X)" To="100" Duration="0:0:0.7" />
            <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" To="-0.02" Duration="0:0:0.7" />
            <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" To="0.8" Duration="0:0:0.7" />
            <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" To="1" BeginTime="0:0:0.7" Duration="0:0:0.7" />
            <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" To="1" BeginTime="0:0:0.7" Duration="0:0:0.7" />
            <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[1].(TranslateTransform.X)" To="0" BeginTime="0:0:0.7"  Duration="0:0:0.7" />
        </Storyboard-->

        <Storyboard x:Key="FadeOutStoryboard">
            <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" To="-0.1" Duration="0:0:0.7" />
            <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" To="0.8" Duration="0:0:0.7" />
            <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[1].(TranslateTransform.X)" To="100" Duration="0:0:0.7" />
            <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[1].(TranslateTransform.Y)" To="20" Duration="0:0:0.7" />
            <DoubleAnimation Storyboard.TargetProperty="Opacity" From="1" To="0.1" Duration="0:0:0.7" />
        </Storyboard>
        <Storyboard x:Key="FadeInStoryboard">
            <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" To="1" Duration="0:0:0.7" />
            <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" To="1" Duration="0:0:0.7" />
            <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[1].(TranslateTransform.X)" To="0" Duration="0:0:0.7" />
            <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[1].(TranslateTransform.Y)" To="0" Duration="0:0:0.7" />
            <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0.1" To="1"  Duration="0:0:0.7" />
        </Storyboard>
        <Storyboard x:Key="HideStoryboard">
            <DoubleAnimation Storyboard.TargetProperty="Opacity" From="1" To="0.1" Duration="0:0:0.7" />
        </Storyboard>
        <Storyboard x:Key="ShowStoryboard">
            <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0.1" To="1"  Duration="0:0:0.7" />
        </Storyboard>

    </UserControl.Resources>

    <Grid Background="Black" Name="infoPanel" UseLayoutRounding="True">

        <Grid.RowDefinitions>
            <RowDefinition Height="10*" />
            <RowDefinition Height="10*"/>
            <RowDefinition Height="10*" MinHeight="200" Name="imageRowDefinition" />
            <RowDefinition Height="10*"/>
            <RowDefinition Height="5*"/>
            <RowDefinition Height="10*"/>
            <RowDefinition Height="5*"/>
        </Grid.RowDefinitions>

        <Label Grid.Row="0" Content="{Binding Artist}" Name="labelArtist" VerticalAlignment="Top" Foreground="#FFF7FAF5" FontSize="64" HorizontalContentAlignment="Center" FontWeight="Bold" />
        <Label Grid.Row="1" Content="{Binding Album}" Name="labelAlbum" VerticalAlignment="Top" Foreground="#FFF7FAF5" FontSize="64" HorizontalContentAlignment="Center" />
        <Image Grid.Row="2" Source="{Binding Image}" Height="200" Name="imageAlbum" Width="200">
            <Image.RenderTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="1" ScaleY="1"/>
                    <TranslateTransform X="0" Y="0"/>
                </TransformGroup>

            </Image.RenderTransform>
        </Image>
        <Label Grid.Row="3" Content="{Binding Title}"  Name="labelTitle" VerticalAlignment="Top" Foreground="#FFF7FAF5" FontSize="64" HorizontalContentAlignment="Center" 
               FontWeight="Bold" Margin="0,10,0,0" />
        <Label Grid.Row="4" Content="{Binding Year}"  Name="labelYear" VerticalAlignment="Top" Foreground="#FFF7FAF5" FontSize="32" HorizontalContentAlignment="Center"  />
        <Expander Grid.Row="5" Header="expander1" Name="expander1">
            <DockPanel LastChildFill="True">
                <Label DockPanel.Dock="Bottom" Name="labelTrackId" VerticalAlignment="Top" Foreground="#FFF7FAF5" FontSize="9" ></Label>
                <ItemsControl Name="checkListBox">
                    <ItemsControl.ItemTemplate>

                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <CheckBox 
                                    Content="{Binding Name}" 
                                    IsChecked="{Binding Flagged}" 
                                    ToolTip="{Binding Explanation}" 
                                    Margin="1" 
                                    Focusable="True" FocusVisualStyle="{DynamicResource CheckListBoxFocus}" 
                                    Checked="CheckBox_Checked" 
                                    Unchecked="CheckBox_Unchecked">
                                </CheckBox>
                            </StackPanel>
                        </DataTemplate>

                    </ItemsControl.ItemTemplate>
                    <!--.ColumnSpan="2"-->
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <WrapPanel ItemWidth="100" Orientation="Vertical" />
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                </ItemsControl>
            </DockPanel>
        </Expander>
        <local:Rating Grid.Row="6" RatingValue="{Binding Rating, Mode=TwoWay}" RatingChanged="Rating_RatingChanged" x:Name="theRating" />
    </Grid>

</UserControl>
